//
//  LLMallDoSuccessViewController.m
//  LoveLove
//
//  Created by 肖兰月 on 2019/4/9.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "LLMallDoSuccessViewController.h"
#import "LLMallDoSuccessView.h"

@interface LLMallDoSuccessViewController ()

@end

@implementation LLMallDoSuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    if (self.type == LLMallDoSuccessViewControllerTypeBargain) {
        self.navTitle = @"砍价成功";
    } else if (self.type == LLMallDoSuccessViewControllerTypeRedemption) {
        self.navTitle = @"换购成功";
    } else {
        self.navTitle = @"拼团成功";
    }
    [self initUI];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.tintColor = UIColor.blackColor;
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:LLRegularFont(18)}];
    self.navigationController.navigationBar.barTintColor = UIColor.whiteColor;
//    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.tintColor = UIColor.blackColor;
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:LLRegularFont(18)}];
    self.navigationController.navigationBar.barTintColor = LLColor(218, 13, 13);
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"底"] forBarMetrics:UIBarMetricsDefault];
}

- (void)initUI {
    LLMallDoSuccessView *successView = [[LLMallDoSuccessView alloc] initWithFrame:self.view.bounds];
    successView.title = [NSString stringWithFormat:@"%@，为您节约",self.navTitle];
    successView.price = [NSString stringWithFormat:@"%@元",self.price];
    [self.view addSubview:successView];
}

@end
